﻿using System;

namespace server05_test_csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Net.IPEndPoint remote = new System.Net.IPEndPoint(new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 }), 8001);

            System.Net.Sockets.UdpClient udp = new System.Net.Sockets.UdpClient();
          

            var senddata = new byte[] { 01, 02, 03 };

            //udp 不需要鏈接，服務器開了，對著發就是
            Console.WriteLine("Hello World!");
            while (true)
            {
                var line = Console.ReadLine();
                if (line == "send")
                {
                    udp.Send(senddata, senddata.Length, remote);
                }
            }
        }
    }
}
